gmfn_to_mfn should return INVALID_MFN when the gpfn is I/O page.
Using PV on HVM, I got the following error message.
(XEN) /xen/include/asm/mm.h:181:d2 Error pfn 2: rd=
f000000007fb4080, od=
0000000000000000, caf=
0000000000000000, taf=
0000000000000000
(XEN) memory.c:165:d2 Bad page free for domain 2
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
if (!pte) {
panic("gmfn_to_mfn_foreign: bad gpfn. spinning...\n");
}
+
+ if ((pte & _PAGE_IO) && is_hvm_domain(d))
+ return INVALID_MFN;
+
return ((pte & _PFN_MASK) >> PAGE_SHIFT);
}